package midware

import (
	"github.com/gin-gonic/gin"
	"post/pkg"
)

func JwtParse() gin.HandlerFunc {
	return func(c *gin.Context) {
		header := c.GetHeader("token")
		token, _ := pkg.GetToken(header)
		c.Set("userId", token)
		c.Next()
	}
}
